//
//  FTBLHeaderView.m
//  FaceTo
//
//  Created by 姚冬元 on 2017/7/30.
//  Copyright © 2017年 chengbangming. All rights reserved.
//

#import "FTBLHeaderView.h"

@implementation FTBLHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self initUI];
    }
    return self;
}

- (void)initUI
{
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    CGFloat circleWidth = kSCREEN_WIDTH/2.5;
    _circle = [[XLCircleProgress alloc] initWithFrame:CGRectMake(kSCREEN_WIDTH/2 -kSCREEN_WIDTH/5, 10, circleWidth, circleWidth)];
    _circle.progress = 0.5;
    [self addSubview:_circle];
    
    UILabel *lbl1 = [[UILabel alloc] init];
    lbl1.text = @"今日积分：200分";
    lbl1.textAlignment = NSTextAlignmentCenter;
    lbl1.textColor = FontColor;
    lbl1.font = LPFont(13);
    [self addSubview:lbl1];
    
    UILabel *lbl2 = [[UILabel alloc] init];
    lbl2.text = @"连接人数：2人";
    lbl2.textAlignment = NSTextAlignmentCenter;
    lbl2.textColor = FontColor;
    lbl2.font = LPFont(13);
    [self addSubview:lbl2];
    
    [lbl1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.offset(kSCREEN_WIDTH/2.5 + 30);
    }];
    
    [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(lbl1.mas_bottom).with.offset(10);
    }];
    
    UIView *grayView = [[UIView alloc] init];
    grayView.backgroundColor = Color(237, 237, 237);
    [self addSubview:grayView];
    
    UILabel *titlelbl = [[UILabel alloc] init];
    titlelbl.text = @"多人模式";
    titlelbl.textColor = FontColor;
    titlelbl.font = LPFont(11);
    [grayView addSubview:titlelbl];
    
    [grayView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.width.mas_equalTo(kSCREEN_WIDTH);
        make.bottom.offset(-0);
        make.height.mas_equalTo(30);
    }];
    
    [titlelbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.centerY.equalTo(grayView.mas_centerY);
    }];
}

@end
